package Top200;

import common.TreeNode;

import java.util.LinkedList;
import java.util.List;

/**
 * @author zhangmin
 * @create 2022-02-27 15:25
 */
public class inorderTraversal94 {
    List<Integer> res=new LinkedList<>();
    void backtrack(TreeNode root){
        if (root==null) return;
        backtrack(root.left);
        res.add(root.val);
        backtrack(root.right);
    }
    public List<Integer> inorderTraversal(TreeNode root) {
        backtrack(root);
        return res;
    }
}
